#ifndef DH_GLOBAL_H
#define DH_GLOBAL_H

typedef enum states
{
  INIT,
  SENT_EXPONENT,
  RECV_EXPONENT,
  EXCHANGE_DONE,
}DH_STATES;

typedef enum events
{
  SENT_EXPONENT_EV,
  RECV_EXPONENT_EV,
  EXCHANGE_EV,  
}DH_EVENTS;



typedef struct dh_params
{
  unsigned int fsm_id;
  unsigned int fsm_state;
  unsigned int sent_exponent:1;
  unsigned int recv_exponent:1;
  unsigned int exchange:1;
  unsigned int base;
  void (*sent_exponent_notify)(DH_PARAMS*);
  void (*recv_exponent_notify)(DH_PARAMS*);
  void (*exchange_notify)(DH_PARAMS*);
  void (*state_table_transition)(DH_PARAMS*,DH_EVENTS);
  
}DH_PARAMS;


typedef struct FLAGS
{
  unsigned int reserved:1;
  unsigned int reserved:1;
  unsigned int reserved:1;
  unsigned int exponent:1;  
  
}DH_FLAGS;


typedef strust dh_packet
{
  unsigned int packet_id:4;
  unsigned int sequence_no:4;
  DH_FLAGS flags:4;
  long exponent; 
  
}DH_PACKET;











#endif